import 'package:flutter/material.dart';
import 'package:flutter_locations/locale_helper.dart';

import 'localizations.dart';

class TestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("第二个页面"),
      ),
      body: Center(
        child: Column(
          children: <Widget>[
            FlatButton(
              child: Text("English"),
              onPressed: (){
                helper.onLocaleChanged(new Locale("en"));
              },
            ),
            FlatButton(
              child: Text("中文"),
              onPressed: (){
                helper.onLocaleChanged(new Locale("zh"));
              },
            ),
            Text(AppLocalizations.of(context).btnsubmit)
          ],
        ),
      ),
    );
  }
}